<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>HTML5的新特性 - 使用Canvas标签绘制矩形示例</title>
	</head>
	<body>
		<canvas id="canvas" width="640" height="360"></canvas>
		<script type="text/javascript">
			//获取context对象
			var canvas = document.getElementById("canvas");
			if(canvas.getContext){
				var context = canvas.getContext("2d");
				
				//设置填充颜色
				context.fillStyle = 'rgb(255,0,0)';
				
				//从坐标(20,30)开始，绘制一个64x36大小的举行
				context.fillRect(20,30,64,36);
			}
		</script>
	</body>
</html>
